package com.xly.webclick.presenter;

import com.xly.webclick.base.BasePresenter;
import com.xly.webclick.model.VersionData;
import com.xly.webclick.net.Request;
import com.xly.webclick.net.RetrofitApi;
import com.xly.webclick.vi.VersionInterFace;

/**
 * Created by xuleyuan on 2018/8/18
 */

public class VersionCheckPresenter extends BasePresenter<VersionInterFace, VersionData> {

    @Override
    public Request<VersionData> createRequest() {
        return new Request<VersionData>().setUrl(RetrofitApi.VERSION).setMethod(Request.POST);
    }

    @Override
    public void onGetResult(VersionData data) {
        getBaseInterface().onVersionCheckSuccess(data);
    }

    @Override
    public void onError(Throwable throwable) {
        getBaseInterface().onVersionCheckFailed();
    }
}
